<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改镀铝分卷加工异常')" />
    <!--<th:block th:include="include :: datetimepicker-css" />-->
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-unusual-edit" th:object="${processUnusual}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">合并材料编号：</label>
                <div class="col-sm-8">
                    <input name="ribbonNumber" th:field="*{ribbonNumber}" disabled class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">原膜编号：</label>
                <div class="col-sm-8">
                    <input type="text" name="inventoryId" disabled th:field="*{number}" class="form-control" id="inventoryIds"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">厂家名称：</label>
                <div class="col-sm-8">
                    <input name="factoryName" th:field="*{factoryName}" class="form-control" disabled type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">材料名称：</label>
                <div class="col-sm-8">
                    <input name="materialsName" th:field="*{materialsName}" class="form-control" disabled type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">颜色：</label>
                <div class="col-sm-8">
                    <input name="color" th:field="*{color}" disabled class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">来料日期：</label>
                <div class="col-sm-8">
                    <input name="mDate" th:field="*{mDate}" disabled class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">发现人：</label>
                <div class="col-sm-8">
                    <select name="discoverer" id="discoverer" class="form-control" data-none-selected-text="请选择">
                        <option value="">请选择</option>
                        <option th:each="user : ${users}" th:text="${user.userName}" th:value="${user.userName}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">发现时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="findDate" id="findDate" autocomplete="off" th:value="${#dates.format(processUnusual.findDate, 'yyyy-MM-dd HH:mm:ss')}"
                               data-type="datetime" class="form-control time-input" data-format="yyyy-MM-dd HH:mm:ss" placeholder="yyyy-MM-dd HH:mm:ss" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">异常原因：</label>
                <div class="col-sm-8">
                    <textarea name="reason" maxlength="500" th:field="*{reason}" class="form-control" rows="3"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <!--<th:block th:include="include :: datetimepicker-js" />-->
    <script th:inline="javascript">
        var prefix = ctx + "process/unusual";
        $("#form-unusual-edit").validate({
            focusCleanup: true
        });

        $(function () {
            var unusual = [[${processUnusual}]];
            $("#discoverer option[value= " + unusual.discoverer + "]").prop("selected",true);
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-unusual-edit').serialize());
            }
        }
    </script>
</body>
</html>